import {
    center,
    input
} from '@/css/DialogsCss.module.scss';
export default {
    title:'新增编辑',
    dialog:{
        size:'50%'
    },
    onMounted: [{
        action:'print',
        value:'$params'
    },{
        action:'set',
        target: '$view',
        field:'title',
        value:'$params.title'
    },{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.form'
    }],
    items: [{
        region: 'center',
        span: 10,
        class: center,
        layout: 'vertical',
        items: [{
            layout: 'vertical',
            items: [{
                id: 'form',
                widget: 'form',
                layout: {
                    type:'gridform',
                    column:2
                },
                fields:[{
                    class: input,
                    itemId: 'real_name',
                    placeholder:'请输入真实姓名',
                    widget:'text',
                    label:'真实姓名',
                },{
                    class: input,
                    itemId: 'birthday',
                    placeholder:'请选择生日',
                    widget:'form-datepicker',
                    label:'生日日期',
                },{
                    class: input,
                    itemId: 'card_id',
                    placeholder:'请输入身份证号码',
                    widget:'text',
                    label:'身份证号',
                },{
                    class: input,
                    itemId: 'gender',
                    placeholder:'请选择性别',
                    widget:'select',
                    dictionary: 'common/static/gender',
                    label:'性别',
                },{
                    class: input,
                    itemId: 'position',
                    placeholder:'请输入职位',
                    widget:'text',
                    // widget:'select',
                    // dictionary: {
                    //     path: 'system/dictionary/config/list',
                    //     params: {
                    //         name: 'crm_customer_position',
                    //     },
                    // },
                    label:'职位',
                },{
                    class: input,
                    itemId: 'phone',
                    placeholder:'请输入手机号码',
                    widget:'text',
                    label:'手机号码',
                },{
                    class: input,
                    itemId: 'tel',
                    placeholder:'请输入座机',
                    widget:'text',
                    label:'座机号码',
                },{
                    class: input,
                    itemId: 'qq',
                    placeholder:'请输入QQ',
                    widget:'text',
                    label:'QQ号码',
                },{
                    class: input,
                    itemId: 'wechat',
                    placeholder:'请输入微信',
                    widget:'text',
                    label:'微信号码',
                },{
                    class: input,
                    itemId: 'email',
                    placeholder:'请输入邮箱',
                    widget:'text',
                    label:'邮箱地址',
                },{
                    class: input,
                    itemId: 'address',
                    placeholder:'请输入联系地址',
                    widget:'text',
                    label:'联系地址',
                },{
                    class: input,
                    itemId: 'entry_time',
                    placeholder:'请选择入职时间',
                    widget:'form-datepicker',
                    type: 'date',
                    label:'入职时间',
                },{
                    class: input,
                    itemId: 'regular_time',
                    placeholder:'请选择转正时间',
                    widget:'form-datepicker',
                    type: 'date',
                    label:'转正时间',
                },{
                    class: input,
                    itemId: 'quit_time',
                    placeholder:'请选择离职时间',
                    widget:'form-datepicker',
                    type: 'date',
                    label:'离职时间',
                },{
                    class: input,
                    itemId: 'remarks',
                    placeholder:'请输入备注说明',
                    widget:'text',
                    label:'备注说明',
                }],
                buttons: [{
                    value: '保存',
                    type: 'primary',
                    onClick: [{
                        action: 'confirm',
                        title: '表单保存',
                        message: '是否保存表单?',
                        confirm: [{
                            var:'value',
                            target:'$widget',
                            action:'call',
                            method:'getValue'
                        },{
                            action: 'service',
                            path: 'crm/sale/save',
                            params: '$vars.value'
                        },{
                            action:'dialog-hide',
                            mode:'apply'
                        }]
                    }]
                }],
                flex: true
            }]
        }]
    }]
};


